How to Create a Scheduled Publish

Contents

Introduction

Quite often, when a Publication Server is set up, there is a scheduled publish set up to publish the Prelive and Sandpit sites. Sometimes, however, it may be chosen to not have scheduled publications originally, but then you may want to set one up later. This article will go through the steps required to move through this process.

Create the scheduled task

Procedure in Windows Server 2008

  1. Log on to the server as the publication user (i.e. the user that runs the Triaster services, such as 'PN Publication Wrapper').
  2. Start > Administrative Tools > Task Scheduler.
  3. On the right-hand side of the window, in the Actions pane, click 'Create Task...'.
  4. In the 'Create Task' dialog, on the 'General' tab, enter an appropriate name for the task.
  5. Select the 'Run whether user is logged in or not' radio button.
  6. Tick 'Run with highest privileges'.
  7. Click the 'Triggers' tab.
  8. Click 'New...'.
  9. Set the appropriate schedule.
  10. Typically, Prelive and Sandpit publications are scheduled to run daily, at or shortly after midnight. Live publications aren't usually scheduled, but can be if required.

  11. Ensure 'Enabled' is ticked.
  12. Click OK to close the 'New Trigger' dialog.
  13. Click the 'Actions' tab.
  14. Click 'New...'.
  15. Ensure 'Action' is set to 'Start a program', click 'Browse...', and select the appropriate scheduling CMD file, typically found in:
  16. "C:\Program Files\Triaster\PublicationServer\PublicationWrapper".

    e.g. select 'schedule live.cmd', 'schedule prelive.cmd', or 'schedule sandpit.cmd'.

  17. Click OK to close the 'New Action' dialog.
  18. Click OK.
  19. Enter the publication user account user name and password, and click OK.

Check the schedule CMD files

The schedule CMD files are typically found in the PublicationWrapper folder, which is commonly in "C:\Program Files\Triaster\PublicationServer\PublicationWrapper".

schedule.cmd

schedule live.cmd

schedule prelive.cmd

schedule sandpit.cmd

Note: those distributed with Triaster Suite 10.1 need to be amended, as described below.

Schedule.cmd

Open schedule.cmd in Notepad.

Note: If running Windows that has User Account Control, e.g. Windows Server 2008, then Notepad needs to run 'as administrator' so that files within 'Program Files', a restricted location, can be edited.

It should look like this:

set PublicationQueueFolder=C:\Program Files\Triaster\PublicationServer\PublicationWrapper\Queue

set TaskName=%1

set TaskName=%TaskName:"=%

set FullTaskName=%PublicationQueueFolder%\%TaskName%.pntask

echo. > "%FullTaskName%"

  • Make sure that the path highlighted is pointing to the publication Queue directory, which will always be a sub-directory of the PublicationWrapper directory.
  • Double-quotes should only enclose the path represented by %FullTaskName%.
  • If the argument passed to this CMD file was enclosed within double-quotes (necessary, if the argument contains a space), those double-quotes are removed automatically so that a valid path is constructed.

Schedule <site name>.cmd

Open 'schedule .cmd' in Notepad.

Note: If running Windows that has User Account Control, e.g. Windows Server 2008, then Notepad needs to run 'as administrator' so that files within 'Program Files', a restricted location, can be edited.

It should contain a single command, like this:

"c:\program files\triaster\publicationserver\PublicationWrapper\schedule.cmd"

PROCESSLIBRARY_LIVE >"c:\program

files\triaster\publicationserver\PublicationWrapper\logs\Schedule live.log"

  • Ensure the paths specified are valid.
  • Ensure paths with spaces are enclosed within double-quotes.
  • Ensure the site name argument is enclosed within double-quotes if it contains a space.

Validation

To test a scheduled task:

  1. Stop the 'PN Publication Wrapper' service.
  2. This will prevent a publication from running, when we only want to check the initiation mechanism.

    1. Start > Administrative Tools > Services.
    2. Right-click 'PN Publication Wrapper' > Stop.
  3. Run the task.
    1. Open the Task Scheduler.
    2. Start > Administrative Tools > Task Scheduler.

    3. In the left-hand pane, click 'Task Scheduler Library'.
    4. In the middle-pane, right-click the task > Run.
  4. Check that the appropriate PNTASK file has been created in the Queue.
    1. In Windows Explorer, navigate to the Queue folder, typically:
    2. "C:\Program Files\Triaster\PublicationServer\PublicationWrapper\Queue"

    3. Check that the appropriate PNTASK file is there, e.g PROCESSLIBRARY_LIVE.pntask, PROCESSLIBRARY_PRELIVE.pntask.
  5. Delete all files from the Queue folder.
  6. Restart the 'PN Publication Wrapper' service.